using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Xml.Serialization;

namespace dender.dvdcover.core
{
    /// <summary>
    /// Defines a location on of a format.
    /// </summary>
    public class Part  : DimensionBase
    {
        private PointF mLocation;
        /// <summary>
        /// Gets or Sets the upper left corner of the part, this point must be
        /// in the area of the cover
        /// </summary>
        /// <exception cref="System.ArgumentOutOfRangeException">
        /// Throws an ArgumentOutOfRangeException when the location is 
        /// outside the cover
        /// </exception>
        public PointF Location
        {
            get
            {
                return mLocation;
            }
            set
            {
                mLocation = value;
            }
        }

        private string mName;
        /// <summary>
        /// Gets or Sets the name of the part
        /// </summary>
        public string Name
        {
            get
            {
                return mName;
            }
            set
            {
                mName = value;
            }
        }
        
        public Part() : base()
        {
        }

        public Part(PointF location, string name,  float width, float height)
            : base(width, height)
        {
            this.Name = name;
            this.Location = location;
        }

        public Part(Part p) : base(p.Width, p.Height)
        {
            this.Location = p.Location;
            this.Name = p.Name;
        }
        
        public virtual bool EqualMembers(Part p)
        {
            return this.Name == p.Name &&
                    this.Height == p.Height &&
                    this.Width == p.Width &&
                    this.Location == p.Location;

        }

        
    }
}
